From: Konstantin Porotchkin Date: Sun, 29 Jul 2018 10:30:51 +0000 (+0300) Subject: plat: marvell: rename common include file X-Git-Url: http://git.openwrt.org/%22https:/collectd.org//%22/%22https:/collectd.org/%22?a=commitdiff_plain;h=94d6dd677bd2b0837810909af80f8e9702bbd841;p=project%2Fbcm63xx%2Fatf.git plat: marvell: rename common include file Rename a8k_common.h to armada_common.h to keep the same header name across all other Marvell Armada platforms. This is especially useful since various Marvell platforms may use common platform files and share the driver modules. Change-Id: I7262105201123d54ccddef9aad4097518f1e38ef Signed-off-by: Konstantin Porotchkin --- diff --git a/drivers/marvell/amb_adec.c b/drivers/marvell/amb_adec.c index 3fb2f389..16fe772d 100644 --- a/drivers/marvell/amb_adec.c +++ b/drivers/marvell/amb_adec.c @@ -7,7 +7,7 @@ /* AXI to M-Bridge decoding unit driver for Marvell Armada 8K and 8K+ SoCs */ -#include +#include #include #include #include diff --git a/drivers/marvell/ccu.c b/drivers/marvell/ccu.c index 1502c3f8..acb1c00c 100644 --- a/drivers/marvell/ccu.c +++ b/drivers/marvell/ccu.c @@ -7,7 +7,7 @@ /* CCU unit device driver for Marvell AP807, AP807 and AP810 SoCs */ -#include +#include #include #include #include diff --git a/drivers/marvell/gwin.c b/drivers/marvell/gwin.c index b5705f7a..a4743eb5 100644 --- a/drivers/marvell/gwin.c +++ b/drivers/marvell/gwin.c @@ -7,7 +7,7 @@ /* GWIN unit device driver for Marvell AP810 SoC */ -#include +#include #include #include #include diff --git a/drivers/marvell/i2c/a8k_i2c.c b/drivers/marvell/i2c/a8k_i2c.c index 737dd0a7..72a77316 100644 --- a/drivers/marvell/i2c/a8k_i2c.c +++ b/drivers/marvell/i2c/a8k_i2c.c @@ -442,7 +442,7 @@ static int marvell_i2c_unstuck(int ret) void i2c_init(void *i2c_base) { /* For I2C speed and slave address, now we do not set them since - * we just provide the working speed and slave address in plat_def.h + * we just provide the working speed and slave address in mvebu_def.h * for i2c_init */ base = (struct marvell_i2c_regs *)i2c_base; diff --git a/drivers/marvell/io_win.c b/drivers/marvell/io_win.c index 40b19821..c0424e08 100644 --- a/drivers/marvell/io_win.c +++ b/drivers/marvell/io_win.c @@ -7,7 +7,7 @@ /* IO Window unit device driver for Marvell AP807, AP807 and AP810 SoCs */ -#include +#include #include #include #include diff --git a/drivers/marvell/iob.c b/drivers/marvell/iob.c index acc4941f..e88bc167 100644 --- a/drivers/marvell/iob.c +++ b/drivers/marvell/iob.c @@ -7,7 +7,7 @@ /* IOW unit device driver for Marvell CP110 and CP115 SoCs */ -#include +#include #include #include #include diff --git a/include/plat/marvell/a8k/common/a8k_common.h b/include/plat/marvell/a8k/common/a8k_common.h deleted file mode 100644 index e7274679..00000000 --- a/include/plat/marvell/a8k/common/a8k_common.h +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (C) 2018 Marvell International Ltd. - * - * SPDX-License-Identifier: BSD-3-Clause - * https://spdx.org/licenses - */ - -#ifndef __A8K_COMMON_H__ -#define __A8K_COMMON_H__ - -#include -#include -#include -#include - -/* - * This struct supports skip image request - * detection_method: the method used to detect the request "signal". - * info: - * GPIO: - * detection_method: HIGH (pressed button), LOW (unpressed button), - * num (button mpp number). - * i2c: - * i2c_addr: the address of the i2c chosen. - * i2d_reg: the i2c register chosen. - * test: - * choose the DIE you picked the button in (AP or CP). - * in case of CP(cp_index = 0 if CP0, cp_index = 1 if CP1) - */ -struct skip_image { - enum { - GPIO, - I2C, - USER_DEFINED - } detection_method; - - struct { - struct { - int num; - enum { - HIGH, - LOW - } button_state; - - } gpio; - - struct { - int i2c_addr; - int i2c_reg; - } i2c; - - struct { - enum { - CP, - AP - } cp_ap; - int cp_index; - } test; - } info; -}; - -/* - * This struct supports SoC power off method - * type: the method used to power off the SoC - * cfg: - * PMIC_GPIO: - * pin_count: current GPIO pin number used for toggling the signal for - * notifying external PMIC - * info: holds the GPIOs information, CP GPIO should be used and - * all GPIOs should be within same GPIO config. register - * step_count: current step number to toggle the GPIO for PMIC - * seq: GPIO toggling values in sequence, each bit represents a GPIO. - * For example, bit0 represents first GPIO used for toggling - * the GPIO the last step is used to trigger the power off - * signal - * delay_ms: transition interval for the GPIO setting to take effect - * in unit of ms - */ -/* Max GPIO number used to notify PMIC to power off the SoC */ -#define PMIC_GPIO_MAX_NUMBER 8 -/* Max GPIO toggling steps in sequence to power off the SoC */ -#define PMIC_GPIO_MAX_TOGGLE_STEP 8 - -enum gpio_output_state { - GPIO_LOW = 0, - GPIO_HIGH -}; - -typedef struct gpio_info { - int cp_index; - int gpio_index; -} gpio_info_t; - -struct power_off_method { - enum { - PMIC_GPIO, - } type; - - struct { - struct { - int pin_count; - struct gpio_info info[PMIC_GPIO_MAX_NUMBER]; - int step_count; - uint32_t seq[PMIC_GPIO_MAX_TOGGLE_STEP]; - int delay_ms; - } gpio; - } cfg; -}; - -int marvell_gpio_config(void); -uint32_t marvell_get_io_win_gcr_target(int ap_idx); -uint32_t marvell_get_ccu_gcr_target(int ap_idx); - - -/* - * The functions below are defined as Weak and may be overridden - * in specific Marvell standard platform - */ -int marvell_get_amb_memory_map(struct addr_map_win **win, - uint32_t *size, uintptr_t base); -int marvell_get_io_win_memory_map(int ap_idx, struct addr_map_win **win, - uint32_t *size); -int marvell_get_iob_memory_map(struct addr_map_win **win, - uint32_t *size, uintptr_t base); -int marvell_get_ccu_memory_map(int ap_idx, struct addr_map_win **win, - uint32_t *size); - -#endif /* __A8K_COMMON_H__ */ diff --git a/include/plat/marvell/a8k/common/armada_common.h b/include/plat/marvell/a8k/common/armada_common.h new file mode 100644 index 00000000..e7274679 --- /dev/null +++ b/include/plat/marvell/a8k/common/armada_common.h @@ -0,0 +1,128 @@ +/* + * Copyright (C) 2018 Marvell International Ltd. + * + * SPDX-License-Identifier: BSD-3-Clause + * https://spdx.org/licenses + */ + +#ifndef __A8K_COMMON_H__ +#define __A8K_COMMON_H__ + +#include +#include +#include +#include + +/* + * This struct supports skip image request + * detection_method: the method used to detect the request "signal". + * info: + * GPIO: + * detection_method: HIGH (pressed button), LOW (unpressed button), + * num (button mpp number). + * i2c: + * i2c_addr: the address of the i2c chosen. + * i2d_reg: the i2c register chosen. + * test: + * choose the DIE you picked the button in (AP or CP). + * in case of CP(cp_index = 0 if CP0, cp_index = 1 if CP1) + */ +struct skip_image { + enum { + GPIO, + I2C, + USER_DEFINED + } detection_method; + + struct { + struct { + int num; + enum { + HIGH, + LOW + } button_state; + + } gpio; + + struct { + int i2c_addr; + int i2c_reg; + } i2c; + + struct { + enum { + CP, + AP + } cp_ap; + int cp_index; + } test; + } info; +}; + +/* + * This struct supports SoC power off method + * type: the method used to power off the SoC + * cfg: + * PMIC_GPIO: + * pin_count: current GPIO pin number used for toggling the signal for + * notifying external PMIC + * info: holds the GPIOs information, CP GPIO should be used and + * all GPIOs should be within same GPIO config. register + * step_count: current step number to toggle the GPIO for PMIC + * seq: GPIO toggling values in sequence, each bit represents a GPIO. + * For example, bit0 represents first GPIO used for toggling + * the GPIO the last step is used to trigger the power off + * signal + * delay_ms: transition interval for the GPIO setting to take effect + * in unit of ms + */ +/* Max GPIO number used to notify PMIC to power off the SoC */ +#define PMIC_GPIO_MAX_NUMBER 8 +/* Max GPIO toggling steps in sequence to power off the SoC */ +#define PMIC_GPIO_MAX_TOGGLE_STEP 8 + +enum gpio_output_state { + GPIO_LOW = 0, + GPIO_HIGH +}; + +typedef struct gpio_info { + int cp_index; + int gpio_index; +} gpio_info_t; + +struct power_off_method { + enum { + PMIC_GPIO, + } type; + + struct { + struct { + int pin_count; + struct gpio_info info[PMIC_GPIO_MAX_NUMBER]; + int step_count; + uint32_t seq[PMIC_GPIO_MAX_TOGGLE_STEP]; + int delay_ms; + } gpio; + } cfg; +}; + +int marvell_gpio_config(void); +uint32_t marvell_get_io_win_gcr_target(int ap_idx); +uint32_t marvell_get_ccu_gcr_target(int ap_idx); + + +/* + * The functions below are defined as Weak and may be overridden + * in specific Marvell standard platform + */ +int marvell_get_amb_memory_map(struct addr_map_win **win, + uint32_t *size, uintptr_t base); +int marvell_get_io_win_memory_map(int ap_idx, struct addr_map_win **win, + uint32_t *size); +int marvell_get_iob_memory_map(struct addr_map_win **win, + uint32_t *size, uintptr_t base); +int marvell_get_ccu_memory_map(int ap_idx, struct addr_map_win **win, + uint32_t *size); + +#endif /* __A8K_COMMON_H__ */ diff --git a/plat/marvell/a8k/a70x0/board/marvell_plat_config.c b/plat/marvell/a8k/a70x0/board/marvell_plat_config.c index 91719867..26b67eb6 100644 --- a/plat/marvell/a8k/a70x0/board/marvell_plat_config.c +++ b/plat/marvell/a8k/a70x0/board/marvell_plat_config.c @@ -5,7 +5,7 @@ * https://spdx.org/licenses */ -#include +#include /* * If bootrom is currently at BLE there's no need to include the memory diff --git a/plat/marvell/a8k/a70x0_amc/board/marvell_plat_config.c b/plat/marvell/a8k/a70x0_amc/board/marvell_plat_config.c index ec4124c1..f8a1c40b 100644 --- a/plat/marvell/a8k/a70x0_amc/board/marvell_plat_config.c +++ b/plat/marvell/a8k/a70x0_amc/board/marvell_plat_config.c @@ -5,7 +5,7 @@ * https://spdx.org/licenses */ -#include +#include /* * If bootrom is currently at BLE there's no need to include the memory diff --git a/plat/marvell/a8k/a80x0/board/marvell_plat_config.c b/plat/marvell/a8k/a80x0/board/marvell_plat_config.c index 43beffab..4948c9a3 100644 --- a/plat/marvell/a8k/a80x0/board/marvell_plat_config.c +++ b/plat/marvell/a8k/a80x0/board/marvell_plat_config.c @@ -5,7 +5,8 @@ * https://spdx.org/licenses */ -#include +#include + /* * If bootrom is currently at BLE there's no need to include the memory * maps structure at this point diff --git a/plat/marvell/a8k/a80x0_mcbin/board/marvell_plat_config.c b/plat/marvell/a8k/a80x0_mcbin/board/marvell_plat_config.c index 079bd8fe..384d0f54 100644 --- a/plat/marvell/a8k/a80x0_mcbin/board/marvell_plat_config.c +++ b/plat/marvell/a8k/a80x0_mcbin/board/marvell_plat_config.c @@ -5,9 +5,10 @@ * https://spdx.org/licenses */ -#include +#include #include #include + /* * If bootrom is currently at BLE there's no need to include the memory * maps structure at this point diff --git a/plat/marvell/a8k/common/mss/mss_bl2_setup.c b/plat/marvell/a8k/common/mss/mss_bl2_setup.c index 21541855..973c56dc 100644 --- a/plat/marvell/a8k/common/mss/mss_bl2_setup.c +++ b/plat/marvell/a8k/common/mss/mss_bl2_setup.c @@ -5,7 +5,7 @@ * https://spdx.org/licenses */ -#include +#include #include #include #include diff --git a/plat/marvell/a8k/common/plat_bl31_setup.c b/plat/marvell/a8k/common/plat_bl31_setup.c index 6c85fcc3..e6ffeeab 100644 --- a/plat/marvell/a8k/common/plat_bl31_setup.c +++ b/plat/marvell/a8k/common/plat_bl31_setup.c @@ -5,7 +5,7 @@ * https://spdx.org/licenses */ -#include +#include #include #include #include diff --git a/plat/marvell/a8k/common/plat_ble_setup.c b/plat/marvell/a8k/common/plat_ble_setup.c index 0cd62cbd..d2607daf 100644 --- a/plat/marvell/a8k/common/plat_ble_setup.c +++ b/plat/marvell/a8k/common/plat_ble_setup.c @@ -5,8 +5,8 @@ * https://spdx.org/licenses */ -#include #include +#include #include #include #include diff --git a/plat/marvell/a8k/common/plat_pm.c b/plat/marvell/a8k/common/plat_pm.c index c716ee0f..ec4b55b3 100644 --- a/plat/marvell/a8k/common/plat_pm.c +++ b/plat/marvell/a8k/common/plat_pm.c @@ -5,7 +5,7 @@ * https://spdx.org/licenses */ -#include +#include #include #include #include